import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/layout/index.vue'

Vue.use(VueRouter)

const routes = [
  { path: '/login', component: () => import('@/views/login/index.vue') },
  {
    path: '/',
    component: Layout,
    redirect: '/dashborad',
    children: [
      { path: 'dashborad', component: () => import('@/views/dashboard/index.vue') },
      { path: 'article', component: () => import('@/views/article/index.vue') }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
